package com.buydeem.share;

import com.buydeem.share.service.UserService;

import java.util.Iterator;
import java.util.ServiceLoader;

public class App {
    public static void main(String[] args) {
        ServiceLoader<UserService> userServices = ServiceLoader.load(UserService.class);
        Iterator<UserService> it = userServices.iterator();
        while (it.hasNext()){
            UserService userService = it.next();
            System.out.printf("用户信息:%s,实现类:%s\n",userService.getUserName(),userService.getClass().getName());
        }
    }
}
